local skill = fk.CreateSkill{
  name = "#th_double_swords_skill",
  attached_equip = "th_double_swords",
}

skill:addEffect(fk.TargetSpecified, {
  can_trigger = function(self, event, target, player, data)
    if target == player and player:hasSkill(skill.name) and
      data.card and data.card.trueName == "slash" then
      return math.abs(data.to.hp - player.hp) == 1
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local to = data.to
    if to:isKongcheng() then
      player:drawCards(1, skill.name)
    else
      local result = room:askToDiscard(to, {
        min_num = 1,
        max_num = 1,
        include_equip = false,
        skill_name = skill.name,
        cancelable = true,
        prompt = "#th_double_swords-invoke:"..player.id,
      })
      if #result == 0 then
        player:drawCards(1, skill.name)
      end
    end
  end,
})

Fk:loadTranslationTable{
  ["#th_double_swords_skill"] = "差分双股剑",
  ["#th_double_swords-invoke"] = "差分双股剑：你需弃置一张手牌，否则 %src 摸一张牌",
}

return skill
